//
//  MYGCommunityExperienceCellModel.swift
//  MYGrow
//
//  Created by lance on 2024/3/2.
//

import UIKit

enum MYGCommunityType: Int {
    case experience = 1
    case question = 2
}

struct MYGCommunityCellModel {
    var id: Int = 0
    var type: MYGCommunityType = .experience
    // experience时候传患者信息 question传医生信息
    var headImageUrl: String = ""
    var name: String = ""
    
    var time: String = ""
    
    var location: String = ""
    
    var title: String = ""
    
    var content: String = ""
    
    var topics: [MYGCommunityTopicModel] = []
    var images: [MYGImagesShowViewImageModel] = []

    var likeNum: Int = 0
    var commentNum: Int = 0
    var isLike: Bool = false

    init(with listModel: MYGCommunityListModel) {
        self.id = listModel.id
        self.title = listModel.communities_patient.title
        self.content = listModel.answer
        self.isLike = (listModel.communities_patient.is_like) == 1
        self.headImageUrl = listModel.doctor.avatar
        self.name = "\(listModel.doctor.name) \(listModel.doctor.title) \(listModel.doctor.department)"
        self.likeNum = listModel.communities_patient.likes
    }
}
